#ifndef DDFUNC_H
#define DDFUNC_H

#define NUMVISBYTE 4

HRESULT DXDDInit (LPDIRECTDRAWSURFACE7 *primsurf,
				LPDIRECTDRAWSURFACE7 *backsurf,
				HWND hWnd);

#define PICT_CIF 0x1

HRESULT LoadPicture(LPDIRECTDRAWSURFACE7 *surf, int Resource, int flags);
HRESULT LoadPicture(LPDIRECTDRAWSURFACE7 *surf, LPCWSTR str, int flags);
HRESULT _LoadPicture(LPDIRECTDRAWSURFACE7 *surf, HANDLE hBmp, int flags);

HRESULT CreateSimpleSurface(int x, int y, LPDIRECTDRAWSURFACE7 *surf);

HRESULT ConvPicture (LPDIRECTDRAWSURFACE7 source,
					 LPDIRECTDRAWSURFACE7 target,
					 LPDIRECTDRAWSURFACE7 example,
					 LPDIRECTDRAWSURFACE7 dexample);

HRESULT GetColors (LPDIRECTDRAWSURFACE7 surf, int* RMatrix,int* GMatrix,
				   int* BMatrix, int iWidth);

HRESULT ClearSurface (LPDIRECTDRAWSURFACE7 surf, int iColor);

#define PICTTSC_INVERSE 1
HRESULT TransformSurfaceColors(LPDIRECTDRAWSURFACE7 surf, int Br, int R, int G, int B, int flags);

HRESULT WriteText (LPCWSTR str, BitmapFont* textbitmap, LPDIRECTDRAWSURFACE7 surf, POINT *place, int iOffset);

HRESULT ReleaseFont(BitmapFont* font);

int TransformMatrix (int *Input, int *Output, int iWidth, int iHeight,
					 float *Matrix, int flags);
int TransformMatrix (int *Input, int *Output, int iWidth, int iHeight,
					 int *Matrix, int flags);

#define PICTTRANS_FORWARD 0x1
#define PICTTRANS_INVERSE 0x0
int IntTransform (int *Input, int *Output,int iWidth, int iHeight, int *Matrix, int Size, int flags);

HRESULT MakeGraySurface(int *Input, LPDIRECTDRAWSURFACE7 surf, int iWidth, int iHeight, int Cap);

int SetDestructionLevel(VSlider* p);
int ChangeImages(PictureList *This);

HRESULT SetTimerText(DWORD Timer, WCHAR * str);

#endif